import Vue from "vue";
import App from "./App.vue";
import router from "./router/router";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import "@/assets/css/base.css";
import axios from "axios";
import VueAxios from "vue-axios";
import scroll from "vue-seamless-scroll";
import store from './store'
// 引入swiper.css
import "swiper/css/swiper.css";
// 引入echarts
import echarts from "echarts";
Vue.prototype.$echarts = echarts;
// 全局变量挂载
import globalVal from "@/utils/global.js";
Vue.prototype.globalVal = globalVal;
// 引用cookie
import jsCookie from "js-cookie";
Vue.prototype.$cookie = jsCookie;
// 图形验证码
import SlideVerify from "vue-monoplasty-slide-verify";
Vue.use(SlideVerify);
import "./assets/iconfont/iconfont.css";

// 全局路径挂载
import url from "@/utils/url.js";
Vue.prototype.url = url;

// 全局设置loading
// import { loadingOpen, loadingClose } from "@/utils/loading.js";
// // 挂载方法
// Vue.prototype.loadingOpen = loadingOpen;
// Vue.prototype.loadingClose = loadingClose;
// // 样式要在element下面，要不然可能不生效
import moment from 'moment';
//挂载到原型
Vue.prototype.$moment = moment ;
//汉化，否则显示日期格式是国外的日期格式
moment.locale("zh-CN")

Vue.use(scroll);
Vue.use(VueAxios, axios);

// 全局修改默认配置，点击空白处不能关闭弹窗
ElementUI.Dialog.props.closeOnClickModal.default = false;
// 全局修改默认配置，按下ESC不能关闭弹窗
ElementUI.Dialog.props.closeOnPressEscape.default = false;
Vue.use(ElementUI);

import 'element-ui/lib/theme-chalk/display.css';

Vue.config.productionTip = false;
Vue.prototype.bus = new Vue();
// 将websocket挂载在全局上-接收系统消息
import wsk from "@/utils/websocket.js"; // 引入 websocket
Vue.prototype.$wsk = wsk; // 挂载

import socketApi from "@/utils/socketChat";
Vue.prototype.$socketApi = socketApi; //websocket挂在原型上

import dayjs from "dayjs";
Vue.prototype.$dayjs = dayjs;

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
